package com.ck.express.utils

object MockDeviceInfoProvider {
    // 缓存模拟设备信息
    private var cachedMac: String? = null
    private var cachedIp: String? = null

    fun getMockMacAddress(): String {
        return cachedMac ?: run {
            val newMac = "02:${(0..255).random().toString(16).padStart(2, '0')}:" +
                    "${(0..255).random().toString(16).padStart(2, '0')}:" +
                    "${(0..255).random().toString(16).padStart(2, '0')}:" +
                    "${(0..255).random().toString(16).padStart(2, '0')}:" +
                    "${(0..255).random().toString(16).padStart(2, '0')}"
            cachedMac = newMac
            newMac
        }
    }

    fun getMockIpAddress(): String {
        return cachedIp ?: run {
            val newIp = "10.${(0..255).random()}." +
                    "${(0..255).random()}." +
                    "${(0..255).random()}"
            cachedIp = newIp
            newIp
        }
    }
}
